package com.kcht.sylyg08.ctrl;

import com.kcht.adp.common.log.Logger;
import com.kcht.adp.pagination.Page;
import com.kcht.adp.web.rs.AdpRest;
import com.kcht.sylyg08.ctrl.vo.ManualReportVO;
import com.kcht.sylyg08.dao.ICommandPerDao;
import com.kcht.sylyg08.service.ManualReportService;
import com.kcth.sylyg08.entity.CommandPer;
import com.kcth.sylyg08.entity.ManualReport;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.transaction.Transactional;
import javax.ws.rs.QueryParam;
import java.util.List;

/**
 * @program: G08ProductionLine
 * @description 手动上传功能的controller层，前端直接调用
 * @author: X.Gao
 * @create: 2019-07-23 14:34
 **/

@RequestScoped
@Transactional(Transactional.TxType.NOT_SUPPORTED)
public class ManualReportCtrl {

    @Inject
    private Logger logger;

    @Inject
    private ManualReportService manualReportService;

    //对数据库中的标签记录进行分页查询，并返回给前端
    @AdpRest(principal = "提交报告记录", permission = "提交报告记录")
    public Page<CommandPer, CommandPer> list(Page<CommandPer, CommandPer> page) {

        System.out.println("调用ManualReportCtrl的list方法");

        return manualReportService.list(page);

    }

    //手动上传记录
    @AdpRest(principal = "提交报告记录", permission = "提交报告记录")
    public void singleReport(@QueryParam("ids") List<Integer> ids) {
        manualReportService.singleReport(ids);
    }

    //删除记录
    @AdpRest(principal = "提交报告记录", permission = "提交报告记录")
    public void delete(@QueryParam("ids") List<Integer> ids) {
        manualReportService.delete(ids);
    }

}
